<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>连接字符串</title>
</head>
<body>
<script>
    var hello = 'Hello';
    var name = prompt('Please enter your name', '');
    var greeting;

    document.write(hello + ' ' + name + '<br/>');

    greeting = hello + ' ' + name;

    document.write(greeting);
</script>
</body>
</html>